package mantel;

import static org.junit.Assert.*;

import java.util.ArrayList;

import jsc.combinatorics.Permutations;
import jsc.datastructures.PairedData;

import org.junit.Before;
import org.junit.Test;

public class DistanceMatrixTest {

	DistanceMatrix dm;
	
	@Before
	public void setUp() throws Exception {
		dm = new DistanceMatrix(4);
		for(int i=0;i<dm.getN();i++){
			dm.set(i, i);
		}
	}

	@Test
	public void testToReducedVector() {
		ArrayList<Double> rv = dm.toReducedVector(10, 50);
		System.out.println(rv);
	}
	
	@Test
	public void testGetPairedData(){
		double[] bounds = {0,10};
		PairedData p = dm.getPairedData(dm, bounds);
		System.out.println(p);
	}
	
	@Test
	public void testPermute(){
		System.out.println(dm);
		Permutations ps = new Permutations(dm.getSize()-1);
		DistanceMatrix dP = dm.permute(ps);
		System.out.println(dP);
	}

}
